<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">

<head>
    <th:block th:include="common/common_head :: commonHeader('供应商管理')"/>
    <link rel="stylesheet" th:href="@{/static/js/plugins/jquery-layout/jquery.layout-latest.css}">
	<!-- <style type="text/css">.table {table-layout:fixed;}</style> -->
</head>
<body class="gray-bg">
<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-condition">
            <form id="ssessForm" th:action="@{/ssess/list}" class="form-inline">
                <div class="select-list">
                    <ul>
                        <li class="col-sm-3" style="width: 33%">
                            <label style="width: 120px">供应商编码：</label>
                            <input type="text" name="vendorCode"/>
                        </li>
                        <li class="col-sm-3" style="width: 33%">
                            <label style="width: 120px">供应商名称：</label>
                            <input type="text" name="vendorName" />
                        </li>
                        <li class="col-sm-3" style="width: 33%">
                            <button id="ssessSearchBtn" type="button" class="btn btn-primary btn-rounded btn-sm"><i class="fa fa-search"></i>&nbsp;搜索</button>
                            <button class="btn btn-warning btn-rounded btn-sm" type="reset"><i class="fa fa-eraser"></i>&nbsp;重置</button>
                            <button id="ssessAdvancedSearch" type="button" class="btn btn-primary btn-rounded btn-sm" style="display: none"><i class="fa fa-caret-down"></i>&nbsp;高级搜索</button>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-info order-table">
            <div class="btn-group hidden-xs toolbar" id="ssessToolBar" role="group">
                <a class="btn btn-outline btn-success btn-rounded" onclick="toAddssess()"
                   shiro:hasPermission="ssess:save">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <a class="btn btn-outline btn-success btn-rounded" onclick="toEditssess()">
                    <i class="fa fa-edit"></i> 编辑
                </a>
            </div>
            <table id="ssess" data-mobile-responsive="true">
            
            </table>
        </div>
    </div>
</div>
<!--引入公共js-->
<div th:include="common/onload_js :: onloadJS"></div>
<script type="text/javascript" th:src="@{/static/js/plugins/jquery-layout/jquery.layout-latest.js}"></script>

<!-- Page-Level Scripts -->

<!--  -->
<script type="text/javascript">
    //面向对象
    var searcherBS = Searcher.createBS('#ssess',
        [
            {checkbox: true},
            {title: "供应商编码 ",field:"vendorCode"},
            {title: "物料号 ",field:"materialCode"},
            {title: "工厂 ",field:"werks"},
            {title: "供应商名称", field:"vendorName"},
            {title: "价格分数",field:"priceMark"},
            {title: "交期评分",field:"deliveryTimeMark" },
            {title: "品质评分",field:"qualityMark"},
            {title: "服务评分",field:"serviceMark" },
            {title: "加权",field:"weight"},
            {title:"日期",field:"stockTime"},
            {title: "平均分",field:"average" },
            {title: "年度总的分",field:"yearMark"},
            {title: "备注",field:"remak"}
        ]
    );
    
    /**
     * 查询数据
     */
    function refresh() {
    	searcherBS.refresh();
    }

    /**
     * 跳转至新增页
     */
    function toAddssess() {
        var index=Dialog.openUrl("供应商月度评分", ctxPath + '/modules/ssess/ssess_add.html',{area : ['900px','700px'],
            maxmin: true,
            end: function() {}
        });
        layer.full(index);
    }
 
    /**
     * 编辑
     */
    function toEditssess() {
    	//field:"pkId"
        var rowDatas = searcherBS.getSelectedRows("markId");
        if (rowDatas.length != 1) {
            Dialog.errorMsg("请选择一行进行编辑");
            return;
        }
		var index = Dialog.openUrl("编辑供应商月度评估", ctxPath + '/ssess/toEdit/'+rowDatas,
		    {area : ['900px','700px'],
			  maxmin: true,
		      end: function () {}
		    });
		layer.full(index)
    }
</script>
</body>